<template>
	<view class="content padding-lr">
		<view class="radius padding">
			<u-parse :content="articleInfo.content" :imageProp="imageProp"></u-parse>
		</view>
	</view>
</template>

<script>
	import uParse from '@/components/u-parse/u-parse.vue';
	export default {
		components: {
			uParse
		},
		data() {
			return {
				article_id:0,
				articleInfo:[],
				imageProp:{}
			};
		},
		onLoad: function (option) {
			this.article_id = option.id;
			this.imageProp = {'mode':'widthFix','domain':this.weburl};
			this.loadData();
		},
		methods: {
			loadData:function(){
				//获取基础参数
				// uni.showLoading({
				// 	title:"数据加载中",
				// 	mask:true
				// })
				let timestamp = this.helper.now();
				let sign = this.helper.setSign(['id='+this.article_id,'timestamp='+timestamp]);
				this.helper.req({
					api:"getArticle",
					timestamp:timestamp,
					data:{id:this.article_id},
					header:{sign:sign},
					method:'GET',
				}).then(res=>{
					this.articleInfo = res.data.data.articleInfo;
					uni.setNavigationBarTitle({
						title: this.articleInfo.title
					});
					uni.hideLoading();
				})
			}
		},
	};
</script>

<style lang="scss">
	page {
		background-color: #ddeafd;
		color: #56595d;
	}
</style>
